<?php
include_once(VENDORS . 'simple_html_dom.php');
App::uses('AppController', 'Controller');

class HomeController extends AppController {
	public $uses = array('Wordpress');
	
	public function index() {
		$links = $this->Wordpress->find('list', array('fields' => array('link')));
		$result = array();
		foreach ($links as $link) {
			$html = file_get_html($link);
			$e = $html->find('.item-preview content-box');
			foreach ($e as $ele) {
				array_push($result, $ele->outertext);
			}
		}
		$this->set(compact('result'));
	}
}